package com.pacai.Method;

public class MethodExercise02 {
    public static void main(String[] args) {
        Person person = new Person();
        person.name = "jack";
        person.age = 18;
        MyTools1 myTools = new MyTools1();
//        myTools.printArr();
        System.out.println(person);
        System.out.println(myTools.copy(person));
        System.out.println(person == myTools.copy(person));

    }
}

class MyTools1 {
    public void printArr(int[][] arr) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j]);
            }
            System.out.println();
        }
    }

    public Person copy(Person p) {
        Person p1 = new Person();
        p1.name = p.name;
        p1.age = p.age;
        return p1;
    }
}
